# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.Spectrum.V1explorer.Model.GeoLocation do
  @moduledoc """
  This parameter is used to specify the geolocation of the device.

  ## Attributes

  - confidence (integer()): The location confidence level, as an integer percentage, may be required, depending on the regulatory domain. When the parameter is optional and not provided, its value is assumed to be 95. Valid values range from 0 to 99, since, in practice, 100-percent confidence is not achievable. The confidence value is meaningful only when geolocation refers to a point with uncertainty. Defaults to: `null`.
  - point (GeoLocationEllipse): If present, indicates that the geolocation represents a point. Paradoxically, a point is parameterized using an ellipse, where the center represents the location of the point and the distances along the major and minor axes represent the uncertainty. The uncertainty values may be required, depending on the regulatory domain. Defaults to: `null`.
  - region (GeoLocationPolygon): If present, indicates that the geolocation represents a region. Database support for regions is optional. Defaults to: `null`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :confidence => any(),
          :point => GoogleApi.Spectrum.V1explorer.Model.GeoLocationEllipse.t(),
          :region => GoogleApi.Spectrum.V1explorer.Model.GeoLocationPolygon.t()
        }

  field(:confidence)
  field(:point, as: GoogleApi.Spectrum.V1explorer.Model.GeoLocationEllipse)
  field(:region, as: GoogleApi.Spectrum.V1explorer.Model.GeoLocationPolygon)
end

defimpl Poison.Decoder, for: GoogleApi.Spectrum.V1explorer.Model.GeoLocation do
  def decode(value, options) do
    GoogleApi.Spectrum.V1explorer.Model.GeoLocation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Spectrum.V1explorer.Model.GeoLocation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
